<template>
  <div>
    <div style="margin-bottom: 10px">
      <a-input-search placeholder="请输入项目名称" style="width: 350px" v-model="projectname" enter-button @search="onSearch()"/>
    </div>

  <a-list :grid="{ gutter: 16, xs: 1, sm: 2, md: 4, lg: 4, xl: 6, xxl: 3 }" :data-source="this.recordsdata">
    <a-list-item slot="renderItem" slot-scope="item, index">
      <a-card :title="'项目名称：'+item.projectName" :description="item.time">
      <ProfessorProject :item="item"></ProfessorProject>
      </a-card>
    </a-list-item>
  </a-list>
  </div>
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import {postAction} from '@/api/manage'
  import {getAction} from "../../api/manage";
  import ProfessorProject from "./modules/ProfessorProject";
  import ARow from "ant-design-vue/es/grid/Row";

  export default {
    name:"MyProfessorProject",
    components: {ARow, ProfessorProject},
    data() {
      return {
        projectname:"",
        leaveCause:"",
        visible:false,
        recordsdata:null,
        url: {
          list: "/projectProfessorInfo/listByProfessorId01",
          list03:"/projectProfessorInfo/listByProfessorId03"
        },
      };
    },
    mounted(){
      getAction(this.url.list).then((res) => {
        this.recordsdata=res.result.records;
      })
    },
    methods: {
      onSearch(){
        console.log(this.projectname)
        let params={
          projectName:this.projectname,
        }
        postAction(this.url.list03,params).then((res)=>{
          if(res.success!=null){
            if (res.success){
              this.recordsdata=res.result.records;
            }
          }
        })
      },
      showModal(item) {
        // 显示请假框
        console.log(item);
        this.visible = true;
        this.itemdata=item;
      },
      handleCancel(){
        this.visible = false;
      },
    }
  };
</script>
<style></style>